package com.galaxy.device.domain.bo;

import com.galaxy.common.core.validate.AddGroup;
import com.galaxy.common.core.validate.EditGroup;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.device.domain.DeviceStatus;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 设备状态业务对象
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = DeviceStatus.class, reverseConvertGenerate = false)
public class DeviceStatusBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 设备ID
     */
    @NotNull(message = "设备ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long deviceId;

    private String deviceNo;

    /**
     * 温度
     */
    private BigDecimal temperature;

    /**
     * 湿度
     */
    private BigDecimal humidity;

    /**
     * 信号强度(0-100)
     */
    private Integer signalStrength;

//    /**
//     * 货道总数量
//     */
//    private Integer channelCount;

    /**
     * 最后在线时间
     */
    private LocalDateTime lastOnlineTime;

    /**
     * 最后维护时间
     */
    private LocalDateTime lastMaintenanceTime;

    /**
     * 维护周期(天)
     */
    private Integer maintenanceCycle;

    /**
     * 备注
     */
    @Size(min = 0, max = 200, message = "备注长度不能超过200个字符")
    private String note;
}
